<!DOCTYPE html>
<html>


	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			div {
				width: 1000px;
				height: 500px;
				text-align: center;
				border: 2px solid;
			}
		</style>
	</head>
 

	<body>
		<div>
			<canvas id="Mycanvas" width="1000px" height="500px"></canvas>
			<script type="text/javascript">
				var canvas = document.getElementById("Mycanvas");
				var ctx = canvas.getContext("2d");
				var rot = 0;
				setInterval(function() {
					var x = Math.cos(rot / 180 * Math.PI) * 100;
					var y = Math.sin(rot / 180 * Math.PI) * 100;
					ctx.clearRect(0, 0, 1000, 500);
					ctx.beginPath();
					ctx.fillStyle = "yellowgreen";
					ctx.fillRect(0, 0, 1000, 500);


					ctx.arc(250, 250, 200, (rot / 180) * Math.PI, (1 + rot / 180) * Math.PI, true);
					ctx.fillStyle = "black";
					ctx.fill();
					ctx.beginPath();
					ctx.arc(250, 250, 200, (rot / 180) * Math.PI, (1 + rot / 180) * Math.PI);
					ctx.fillStyle = "white";
					ctx.fill();


					ctx.beginPath();
					ctx.arc(250 - x, 250 - y, 100, 0, 2 * Math.PI);
					ctx.fillStyle = "black";
					ctx.fill();
					ctx.beginPath();
					ctx.arc(250 + x, 250 + y, 100, 0, 2 * Math.PI);
					ctx.fillStyle = "white";
					ctx.fill();


					ctx.beginPath();
					ctx.arc(250 - x, 250 - y, 30, 0, 2 * Math.PI);
					ctx.fillStyle = "white";
					ctx.fill();
					ctx.beginPath();
					ctx.arc(250 + x, 250 + y, 30, 0, 2 * Math.PI);
					ctx.fillStyle = "black";
					ctx.fill();
					rot = rot + 5;
				}, 50)
			</script>
		</div>
	</body>


</html>
